package com.bycx.system.service.impl;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bycx.core.exception.BusinessException;
import com.bycx.core.service.BaseService;
import com.bycx.core.util.SessionUtil;
import com.bycx.core.util.StringUtils;
import com.bycx.system.mapper.ASysRoleMapper;
import com.bycx.system.mapper.ASysRoleMenuMapper;
import com.bycx.system.mapper.ASysRoleUserMapper;
import com.bycx.system.model.ASysRole;
import com.bycx.system.model.ASysRoleMenu;
import com.bycx.system.service.IASysRoleService;

@Service
public class ASysRoleServiceImpl implements IASysRoleService{
	
	@Autowired
	private ASysRoleMapper aSysRoleMapper;
	
	@Autowired
	private ASysRoleMenuMapper aSysRoleMenuMapper;
	
	@Autowired
	private ASysRoleUserMapper aSysRoleUserMapper;
	
	@Override
	public ASysRole get(Map<String,Object> params){
		return aSysRoleMapper.get(params);
	}
	
	@Override
	public List<ASysRole> getList(Map<String,Object> params){
		return aSysRoleMapper.getList(params);
	}
	
	
	/**
	 * 角色删除  需要删除角色信息，角色与资源的关系，角色与用户的关系
	 */
	@Override
	public void delete(List<String> ids) {
		for(String id : ids){
			this.delete(id);
		}
	}

	

	/**
	 * 角色删除  需要删除角色信息，角色与资源的关系，角色与用户的关系
	 */
	public void delete(String id) {
		aSysRoleUserMapper.deleteByRoleId(id);
		aSysRoleMenuMapper.deleteByRoleId(id);
		aSysRoleMapper.deleteByPrimaryKey(id);
	}

	@Override
	public void callProcedure() {
		
	}


	@Override
	public ASysRole getBygetByPrimaryKey(String key) {
		return aSysRoleMapper.getByPrimaryKey(key);
	}

	@Override
	public void setBaseMapper() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public ASysRole getByPrimaryKey(Serializable primaryKey) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ASysRole get(String propName, String value) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<ASysRole> getList(String propName, String value) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void save(ASysRole t) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void updateByPrimaryKey(ASysRole t) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteByPrimaryKey(Serializable primaryKey) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteObj(List<ASysRole> list) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void save(ASysRole aSysRole, List<String> menuIds) {
		// TODO Auto-generated method stub
		
	}
}

